<template>
    <el-container class="index-container">
        <el-header class="el-header">
            <div class="logo-icon">
                logo
            </div>
            <div class="header-items">
                <div class="helper-document">
                    asdfsadf
                </div>
                <div class="user-icon" @mouseover="isDisplay = !isDisplay" @mouseout="isDisplay = !isDisplay">
                    <el-avatar src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png" size="small"></el-avatar>
                    <transition name="el-fade-in-linear">
                        <div class="user-icon-pane" v-show="isDisplay">
                            <div class="user-icon-base-info">
                                <span>基本资料</span>
                                <div style="width: 1px;height: 15px;background: #c3c3c3;border-radius: 1px;"></div>
                                <span>校管信息</span>
                            </div>
                            <div class="user-icon-person-info">
                                <div><i class="el-icon-edit"></i><span class="user-icon-person-info-span">修改密码</span></div>
                                <div @click="exit"><i class="el-icon-switch-button"></i><span class="user-icon-person-info-span">退出系统</span></div>
                            </div>
                        </div>
                    </transition>
                </div>
            </div>
        </el-header>
        <el-container class="content-container">
            <el-aside width="200px">
                <el-menu background-color="#333744" text-color="#fff" active-text-color="#409eff" router>
                    <el-menu-item index="/welcome">
                        <template slot="title">
                            <i class="el-icon-menu"></i>
                            <span>控制台</span>
                        </template>
                    </el-menu-item>
                    <el-menu-item index="/copywriting">
                        <template slot="title">
                            <i class="el-icon-menu"></i>
                            <span>营销文案</span>
                        </template>
                    </el-menu-item>
                    <el-menu-item index="/market">
                        <template slot="title">
                            <i class="el-icon-menu"></i>
                            <span>市场管理</span>
                        </template>
                    </el-menu-item>
                    <el-menu-item index="/consult">
                        <template slot="title">
                            <i class="el-icon-menu"></i>
                            <span>招生中心</span>
                        </template>
                    </el-menu-item>
                    <el-menu-item index="/teacher">
                        <template slot="title">
                            <i class="el-icon-menu"></i>
                            <span>教学管理</span>
                        </template>
                    </el-menu-item>
                    <el-menu-item index="/education">
                        <template slot="title">
                            <i class="el-icon-menu"></i>
                            <span>教务管理</span>
                        </template>
                    </el-menu-item>
                    <el-menu-item index="/admin">
                        <template slot="title">
                            <i class="el-icon-menu"></i>
                            <span>行政人事</span>
                        </template>
                    </el-menu-item>
                    <el-menu-item index="/finance">
                        <template slot="title">
                            <i class="el-icon-menu"></i>
                            <span>财务管理</span>
                        </template>
                    </el-menu-item>
                    <el-menu-item index="/framework">
                        <template slot="title">
                            <i class="el-icon-menu"></i>
                            <span>组织架构</span>
                        </template>
                    </el-menu-item>
                </el-menu>
            </el-aside>
            <el-main>
                <router-view></router-view>
            </el-main>
        </el-container>
    </el-container>
</template>

<script>
    export default {
        name: "Index",
        data() {
            return {
                isDisplay: false
            }
        },
        methods: {
            exit() {
                window.sessionStorage.clear()
                this.$router.push('/login')
            }
        }
    }
</script>

<style lang="less" scoped>
    .el-header {
        background-color: #373d41;
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        width: 100%;
        z-index: 100;
    }
    .header-items{
        display: flex;
        -webkit-box-align: center;
        align-items: center;
    }
    .el-button {
        position: absolute;
        right: 20px;
    }

    .el-aside {
        background-color: #333744;
        height: 100%;
        padding-top: 60px;
    }

    .el-aside .el-menu {
        border-right: none;
    }

    .content-container {
        position: relative;
    }

    .el-main {
        background-color: #dfe3ed;
        overflow: hidden;
        overflow-y: scroll;
        margin-top: 60px;
    }

    .index-container {
        height: 100%;
    }

    .user-icon {
        height: 28px;
        right: 20px;
        cursor: pointer;
    }

    .user-icon-pane {
        background: #fff;
        z-index: 10;
        min-width: 200px;
        max-width: 480px;
        position: absolute;
        right: 20px;
        border-width: 1px;
        transition: all 360ms ease 0s;
        border-radius: 5px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
        font-size: 14px;
        color: #373d41;
        padding: 10px 30px;
    }
    .user-icon-base-info{
        flex: 1;
        display: flex;
        justify-content: space-between;
        padding-bottom: 10px;
        border-bottom: 1px solid #dbe5ee;
    }
    .user-icon-person-info{
        text-align: left;
    }
    .user-icon-person-info>div{
        height: 30px;
        line-height: 30px;
    }
    .user-icon-base-info>span:hover,.user-icon-person-info>div:hover{
        transition: all 360ms ease 0s;
        color: #ff6a00;
    }
    .user-icon-person-info>div:hover{
        transition: all 360ms ease 0s;
        background: #a4b1bd1c;
    }
    .user-icon-person-info-span{
        padding-left: 10px;
    }
    /* element内置动画 */
    .transition-box {
        margin-bottom: 10px;
        width: 200px;
        height: 100px;
        border-radius: 4px;
        background-color: #409EFF;
        text-align: center;
        color: #fff;
        padding: 40px 20px;
        box-sizing: border-box;
        margin-right: 20px;
    }
</style>
